package com.lzhsite.technology.designPattern.mediator.ColleagueDemo;

import java.util.Hashtable;

public abstract class AbstractMediator
{
    protected Hashtable<String, AbstractColleague> colleagues = new Hashtable<String, AbstractColleague>();

    public void addColleague(String name, AbstractColleague colleague)
    {
    	//在这里把自己注册进中介mediator,与其取得联系
        colleague.setMediator(this);
        this.colleagues.put(name, colleague);
    }

    public void deleteColleague(String name)
    {
        this.colleagues.remove(name);
    }

    public abstract void execute(String name, String method);
}
